<template>
	<view style="width: 100%;">
		<view>
			<uni-list>
				<uni-list-item title="合格证号(NO)" :note="datas.certificateNumber" :show-arrow="false"/>
				<uni-list-item title="系统编号" :note="datas.code" :show-arrow="false"/>
				<uni-list-item title="货主" :note="datas.shipperName" :show-arrow="false"/>
				<uni-list-item title="联系电话" :note="datas.shipperTel" :show-arrow="false"/>
				<uni-list-item title="动物种类" :note="datas.animalType" :show-arrow="false"/>
				<uni-list-item title="规格及数量" :note="datas.numUnit" :show-arrow="false"/>
				<uni-list-item title="用途" :note="datas.purpose" :show-arrow="false"/>
				<uni-list-item title="起运地点" :note="datas.departureAddress" :show-arrow="false"/>
				<uni-list-item title="到达地点" :note="datas.arrivalAddress" :show-arrow="false"/>
				<uni-list-item title="水产苗种生产许可证号" :note="datas.productionLicenseNumber" :show-arrow="false"/>
				<uni-collapse accordion="true" >
					<uni-collapse-item title="牲畜耳标号" animation="true">
						<view style="margin-left: 30upx;" v-for="item in datas.animalEarLabel"><span>质量合格证号:{{item.qcNumber}}</span> <span style="padding-left: 10upx;">规格：{{item.spec}}</span> <span style="padding-left: 10upx;">数量:{{item.number}} </span></view>
					</uni-collapse-item>
				</uni-collapse>
				<uni-list-item title="签发日期" :note="datas.issuanceTime|dateFormat" :show-arrow="false"/>
			</uni-list>
			
		</view>
	</view>
</template>

<script>
	import uniList from '@/components/uni-list/uni-list.vue';
	import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
	import uniCollapse from "@/components/uni-collapse/uni-collapse.vue"
	import uniCollapseItem from "@/components/uni-collapse-item/uni-collapse-item.vue";
	import loginjs from '@/login.js'
	import {
		mapState
	} from 'vuex'
	export default {
		computed: mapState(['baseUrl']),
		components: {
			uniCollapse,
			uniCollapseItem,
			uniList,
			uniListItem
			
		},
		data() {
			return {
				Authorization: null,
				datas: {

				}
			}
		},
		methods: {
			onLoad(option) {
				this.Authorization = loginjs.getAuthorization();
				console.log(option.id)
				this.getList(option.id)
			},
			getList(id) {
				uni.request({
					method: "GET",
					url: this.baseUrl + 'api/quarantine/certification/' + id,
					header: {
						"Authorization": this.Authorization,
					},
					success: (res) => {
						this.datas = res.data.data
						this.datas.animalEarLabel=JSON.parse(this.datas.animalEarLabel)
					}
				})
			}
		}
	}
</script>

<style>

</style>
